# #文件打开open(),encoding=utf-8
# #open()打开得到的是一个文件对象
# f = open(r'C:\Users\Administrator\Desktop\1111.txt', encoding='utf8')
# print(f.read())
# #读取文件内容
# with open(r'C:\Users\Administrator\Desktop\1111.txt', encoding='utf8') as file:
#     text = file.read()
# print(text)
#
# #写文件write()
# data = 'hello,world'
# f1 = open('222.txt', 'w',encoding='utf8')
# f1.write('hello yyy')
# f1.close()
#
# #打开文件用于写入，如果文件不存在将会被创建
# with open('222.txt', 'w',encoding='utf8') as file:
#     file.write(data)

# import pandas as pd
# p1 = pd.read_excel(r"C:\Users\Administrator\Desktop\111.xlsx")
# print(p1)


# 写文件到excle
# import pandas as pd
#
# a1={"name": "lizong", "age": 18}
# a2={"name": "yanmou", "age": 19}
# a3={"name": "xiao", "age": 17}
# l=[a1, a2, a3]
# print(l)
# df1=pd.DataFrame(l)
# print(df1)
# df1.to_excel("222.xlsx", index=False)


# from docx import Document
# doc = Document(r"C:\Users\Administrator\Desktop\2023年国务院政府工作报告.docx")
# print(doc)
# p=doc.paragraphs
# print(p)
# print(len(p))
# for i in p:
#     print(i.text)